package cn.gene.timeyan.ums.webapi.ums.mapper;

import cn.gene.timeyan.pojo.ums.vo.HonorVO;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

@Repository
public interface HonorUserMapper {
    @DS("scoreLevel")
    //获取用户拥有的徽章id
    List<HonorVO> getUserHonorListByUserId(@Param("userId") Long userId);
    //添加用户获取徽章的记录
    //有获取时间（缓存）
    @DS("scoreLevel")
    int addUserHonorByRedis(@Param("userId")Long userId, @Param("honorId")Long honorId, @Param("gainTime") LocalDateTime gainTime);
    @DS("scoreLevel")
    int verifyUserHonor(@Param("honorId") Long honorId,@Param("userId") Long userId);

}
